<h1>Procesadores disponibles</h1>

<table border=1>
  <tr>
    <th>Título</th>
    <th>Descripcion</th>
    <th>Nº núcleos</th>
    <th>Velocidad del reloj (MHz)</th>
    <th>Niveles de caché</th>
    <th>Tamaño caché</th>
    <th>URL</th>
    <th>Precio</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @processors.each do |processor| %>
  <tr>
    <td><%= processor.title %></td>
    <td><%= processor.description %></td>
    <td><%= processor.cores %></td>
    <td><%= processor.clockspeed %></td>
    <td><%= processor.cachelevel %></td>
    <td><%= processor.cachecapacity %></td>
    <td><%= link_to processor.product_url, processor.product_url, :target => '_blank' %></td>
    <td><%= processor.price %></td>
    <td><%= link_to 'Mostrar', processor %></td>
    <td><%= link_to 'Editar', edit_processor_path(processor) %></td>
    <td><%= link_to 'Eliminar', processor, method: :delete, data: { confirm: '¿Está seguro?' } %></td>
  </tr>
<% end %>
</table>


<br />

<%= link_to 'Nuevo procesador', new_processor_path %>





<% if notice %>
<p id="notice"><%= notice %></p>
<% end %>

<h1>Catalogo de procesadores</h1>

<% @products.each do |product| %>
	<div class="entry">
		<h3><%= product.title %></h3>
		<%= sanitize(product.description) %>
		<div class="price_line">
			<span class="price"><%= number_to_currency(product.price) %></span>
			<%= button_to 'Añadir al carro', line_product_path(product_id: product) %>
		</div>
	</div>
<% end %>
